package com.xianyun.site.iblog.support.command;

import com.alibaba.cola.dto.Response;
import com.xianyun.site.support.dto.SmtpSendCmd;
import com.xianyun.site.iblog.gatewayimpl.SmtpGatewayImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 发送邮件
 * @author mac_zyj
 */
@Component
public class SmtpSendCmdExo {
    @Autowired
    private SmtpGatewayImpl smtpGateway;

    public Response execute(SmtpSendCmd cmd) {
        cmd.initSmtp();
        return smtpGateway.sendSmtpMessage(cmd.getReceiveCmd().getSmtpMessage());
    }
}
